{extend name="layout/main-block" /}
<!-- main content start -->
{block name="content"}
<link href="/static/js/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">修改</a></li>
            </ol>

        </div>
        <div class="row content-main">
            <div class="col-sm-12 col-md-8 col-lg-6">
                <form id="news-add" class="form-horizontal" action="{:url('backend/lists/lists_update',['type'=>$type,'list_id'=>$list_id])}" enctype="multipart/form-data" method="post">
                    <div class="form-group">
                        <label for="inputList_title_cn" class="col-sm-3  col-md-4 col-lg-3 control-label">名称中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="list_title_cn" class="form-control" id="inputList_title_cn" value="{$lists.list_title_cn}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputList_title_en" class="col-sm-3 col-md-4 col-lg-3 control-label">名称英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" name="list_title_en" class="form-control" id="inputList_title_en" value="{$lists.list_title_en}">
                        </div>
                    </div>
                    <div id="newsneed">
                    <div class="form-group">
                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">新闻时间</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input type="text" id="datetimepicker" name="news_time" class="form-control" value="{$lists.news_time}" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputTitle_introduce_cn" class="col-sm-3 col-md-4 col-lg-3 control-label">新闻简介中文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <textarea name="title_introduce_cn" class="form-control" id="inputTitle_introduce_cn" >{$lists.title_introduce_cn}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputTitle_introduce_en" class="col-sm-3 col-md-4 col-lg-3 control-label">新闻简介英文</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <textarea name="title_introduce_en" class="form-control" id="inputTitle_introduce_en" >{$lists.title_introduce_en}</textarea>
                        </div>
                    </div>
                    {if condition="$lists.img_url neq ''" }
                    <div class="form-group">
                        <div class="col-sm-9 col-sm-offset-4">
                            <img src="{$lists.img_url}" alt="" width="200">
                        </div>
                    </div>
                    {/if}
                    <div class="form-group">
                        <label for="inputImg_url" class="col-sm-3 col-md-4 col-lg-3 control-label">新闻图片</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            <input id="inputImg_url" name="image[]" type="file"  value="浏览" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 col-md-4 col-lg-3 control-label">应用到其他模块</label>
                        <div class="col-sm-9 col-md-8  col-lg-9">
                            {$str}
                        </div>
                    </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-3 col-md-offset-4 col-sm-9 col-md-8  col-lg-9">
                            <button type="submit" class="btn btn-primary">修 改</button>
                            <input type="hidden" id="img_type" name="img_type" value="4">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
</section>
{/block}

{block name="javascript"}
<script type="text/javascript" src="/static/js/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.min.js" charset="UTF-8"></script>
<script>
    $(function () {
        //时间插件
        $('#datetimepicker').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            todayBtn: true
        });

        //新闻跟文章模板不同
        var type_id = '{$type_id}';
        //console.log(type_id);
        if (type_id == 1) {
            $("#newsneed").css("display", "block");//显示div
        } else if (type_id == 2) {
            //$("#newsneed").addClass('green');
            $("#newsneed").css("display", "none");//隐藏div
        }
    });
</script>
{/block}

